<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
        任务执行的顺序是同步任务 微任务 宏任务
        setTimeout内有微任务,setTimeout不会停止执行
     -->
    <script>
        let p1 = new Promise((resolve,rejext)=>{
            resolve()
        }).then(resolve=>{
            console.log('成功');
        })
        let p2 = new Promise((resolve,rejext)=>{
            resolve()
        }).then(resolve=>{
            console.log('success');
        })
        console.log(p1,p2);//成功和success先打印  状态为成功状态  结果为 undefind
        // setTimeout(()=>{
        //     console.log(p1,p2)
        // },0)             //成功和success后打印      状态为成功状态  结果为 undefind
    </script>
</body>
</html>